package demo1107.demo01;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/7 15:24
 */
public class Test01 {
    public static void main(String[] args) {
        LocalDateTime dateTime = LocalDateTime.of(2022, 10, 07, 15, 26, 30);

        LocalDateTime now = LocalDateTime.now();

        System.out.println(dateTime);
        System.out.println(now);

        LocalDate date = LocalDate.of(2022, 1, 1);
        LocalDate now1 = LocalDate.now();
        System.out.println(date);
        System.out.println(now1);

        System.out.println(now1.getYear());
        System.out.println(now1.getMonth().getValue());
        System.out.println(now1.getDayOfWeek().getValue());

        LocalTime time = LocalTime.of(11, 11, 11);
        LocalTime now2 = LocalTime.now();

        System.out.println(time);
        System.out.println(now2);

        System.out.println(now2.getHour());
        System.out.println(now2.getMinute());
        System.out.println(now2.getSecond());
        System.out.println(now2.getNano());

    }
}
